package com.team.app.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.team.app.dao.EmployeeDao;
import com.team.app.model.Employee;


@Service
public class EmployeeServiceImpl implements EmployeeService{
	@Autowired
    private EmployeeDao employeeDao;     

	@Override
	@Transactional
	public Long create(Employee obj) {
		// TODO Auto-generated method stub
		return employeeDao.create(obj);
	}

	@Override
	@Transactional
	public void edit(Employee obj) {
		// TODO Auto-generated method stub
		employeeDao.edit(obj);
	}

	@Override
	@Transactional
	public void remove(Employee obj) {
		// TODO Auto-generated method stub
		employeeDao.remove(obj);
	}

	@Override
	@Transactional
	public Employee find(Object id) {
		// TODO Auto-generated method stub
		return employeeDao.find(id);
	}

	@Override
	@Transactional
	public List<Employee> findAll() {
		// TODO Auto-generated method stub
		return employeeDao.findAll();
	}

	@Override
	@Transactional
	public List<Employee> findRange(int[] range) {
		// TODO Auto-generated method stub
		return employeeDao.findRange(range);
	}

	@Override
	@Transactional
	public Long count() {
		// TODO Auto-generated method stub
		return employeeDao.count();
	}

	@Override
	@Transactional
	public List<Employee> findAll(Long companyId) {
		// TODO Auto-generated method stub
		return employeeDao.findAll(companyId);
	}

	@Override
	@Transactional
	public List<Employee> findAll(Employee obj, Long companyId) {
		// TODO Auto-generated method stub
		return employeeDao.findAll(obj, companyId);
	}

	@Override
	@Transactional
	public boolean existEmail(String email) {
		// TODO Auto-generated method stub
		return employeeDao.existEmail(email);
	} 
}
